﻿<%@ Page Language="VB" MasterPageFile="~/NavegacaoMaster.master" AutoEventWireup="false"
  CodeFile="AdmFranquia.aspx.vb" Inherits="AdmFranquia" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
  <asp:ScriptManager ID="scriptManager" runat="server" />
  <asp:UpdatePanel ID="updPanel" runat="server">
    <ContentTemplate>
      <asp:Label ID="lblTituloPagina" runat="server" Font-Bold="True" CssClass="titulo-pagina" />
      <asp:FormView ID="fv_Usuario" runat="server" DataKeyNames="IdFranquia" Width="100%">
        <ItemTemplate>
          <div style="width: 73%; float: left;">
            <br />
            <strong>Nome: </strong>
            <asp:Label ID="lbl_Cpf" runat="server" Text='<%# Bind("Nome") %>' /><br />
            <strong>País: </strong>
            <asp:Label ID="lbl_Email" runat="server" Text='<%# Bind("Pais") %>' /><br />
            <strong>Estado: </strong>
            <asp:Label ID="lbl_Franquia" runat="server" Text='<%# Eval("Uf") %>' /><br />
            <strong>Cidade: </strong>
            <asp:Label ID="lbl_GrupoAcesso" runat="server" Text='<%# Eval("Cidade") %>' /><br />
            <strong>Endereço: </strong>
            <asp:Label ID="lbl_Pais" runat="server" Text='<%# Bind("Logradouro") %>' /><br />
            <strong>CEP: </strong>
            <asp:Label ID="lbl_Cep" runat="server" Text='<%# Bind("Cep") %>' /><br />
            <strong>Telefone: </strong>
            <asp:Label ID="lb_Uf" runat="server" Text='<%# Bind("Telefone") %>' /><br />
            <strong>Email: </strong>
            <asp:Label ID="lbl_Cidade" runat="server" Text='<%# Bind("Email") %>' /><br />
            <div style="float: left;">
              <strong>Informações:&nbsp;&nbsp;</strong>
            </div>
            <div style="float: left;">
              <asp:TextBox ID="txt_Informacoes" runat="server" Height="50px" Text='<%# Bind("Informacoes") %>'
                TextMode="MultiLine" Width="340px" BorderStyle="None" />
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
          </div>
          <div style="width: 25%; float: right;">
            <asp:Image ID="img_Avatar" runat="server" ImageUrl='<%# "~/imagens/avatar/" & IIF(Eval("Avatar")="", "sem_avatar.jpg", Eval("Avatar")) %>'
              BorderWidth="1" AlternateText="" />
            <br />
            <asp:LinkButton ID="lnkEditar" runat="server" Text="Editar minha franquia" Font-Bold='true'
              OnClick="lnkEditar_Click" />
            </td>
          </div>
        </ItemTemplate>
        <EditItemTemplate>
          <br />
          <asp:Label ID="lbl_Avatar" runat="server" Text='<%# Bind("Avatar") %>' Visible="false" />
          <div style="float: left; width: 437px" class="texto-menor">
            <div style="width: 50px; float: left;">
              Nome
            </div>
            <div style="float: left;">
              <asp:TextBox ID="txt_Nome" runat="server" Width="380px" MaxLength="60" Text='<%# Bind("Nome") %>' />
              <asp:RequiredFieldValidator ID="rfv_nome" runat="server" ControlToValidate="txt_nome"
                Display="none" ErrorMessage="Preencha o Nome da Franquia" SetFocusOnError="true" />
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
            <div style="width: 50px; float: left;">
              Pais
            </div>
            <div style="float: left;">
              <asp:TextBox ID="txt_Pais" runat="server" Width="270px" Text='<%# Bind("Pais") %>'
                MaxLength="100" />&nbsp;&nbsp;&nbsp;
            </div>
            <div style="float: left;">
              CEP&nbsp;&nbsp;
            </div>
            <div style="float: left;">
              <asp:TextBox ID="txt_Cep" runat="server" Text='<%# Bind("Cep") %>' Width="70px" />
              <cc1:MaskedEditValidator ID="mev_Cep" runat="server" ControlExtender="mee_Cep" ControlToValidate="txt_Cep"
                Display="Dynamic" ErrorMessage="Formato do CEP inválido" InvalidValueBlurredMessage="* Formato do CEP inválido"
                InvalidValueMessage="Formato do CEP inválido" SetFocusOnError="true" ValidationExpression="^(\d{5})?(-)?\d{3}$" />
              <cc1:MaskedEditExtender ID="mee_Cep" runat="server" ClearMaskOnLostFocus="True" Mask="99999-999"
                TargetControlID="txt_Cep" />
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
            <div style="width: 50px; float: left;">
              UF
            </div>
            <div style="float: left;">
              <asp:DropDownList ID="ddl_Uf" runat="server" SelectedValue="<%# bind('Uf') %>" Width="60px">
                <asp:ListItem></asp:ListItem>
                <asp:ListItem>AC</asp:ListItem>
                <asp:ListItem>AL</asp:ListItem>
                <asp:ListItem>AP</asp:ListItem>
                <asp:ListItem>AM</asp:ListItem>
                <asp:ListItem>BA</asp:ListItem>
                <asp:ListItem>CE</asp:ListItem>
                <asp:ListItem>DF</asp:ListItem>
                <asp:ListItem>GO</asp:ListItem>
                <asp:ListItem>ES</asp:ListItem>
                <asp:ListItem>MA</asp:ListItem>
                <asp:ListItem>MT</asp:ListItem>
                <asp:ListItem>MS</asp:ListItem>
                <asp:ListItem>MG</asp:ListItem>
                <asp:ListItem>PA</asp:ListItem>
                <asp:ListItem>PB</asp:ListItem>
                <asp:ListItem>PR</asp:ListItem>
                <asp:ListItem>PE</asp:ListItem>
                <asp:ListItem>PI</asp:ListItem>
                <asp:ListItem>RJ</asp:ListItem>
                <asp:ListItem>RN</asp:ListItem>
                <asp:ListItem>RS</asp:ListItem>
                <asp:ListItem>RO</asp:ListItem>
                <asp:ListItem>RR</asp:ListItem>
                <asp:ListItem>SP</asp:ListItem>
                <asp:ListItem>SC</asp:ListItem>
                <asp:ListItem>SE</asp:ListItem>
                <asp:ListItem>TO</asp:ListItem>
              </asp:DropDownList>
            </div>
            <div style="float: right;">
              <asp:TextBox ID="txt_Cidade" runat="server" Width="250px" Text='<%# Bind("Cidade") %>'
                MaxLength="60" />
            </div>
            <div style="float: right;">
              Cidade&nbsp;&nbsp;
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
            <div style="float: left;">
              Logradouro
            </div>
            <div style="float: right;">
              <asp:TextBox ID="txt_Logradouro" runat="server" Width="365px" Text='<%# Bind("Logradouro") %>'
                MaxLength="60" />
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
            <div style="width: 50px; float: left;">
              Telefone
            </div>
            <div style="float: left;">
              <asp:TextBox runat="server" ID="txt_Telefone" Width="165px" MaxLength="70" Text='<%# Bind("Telefone") %>' />
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
            <div style="width: 50px; float: left;">
              E-mail
            </div>
            <div style="float: left;">
              <asp:TextBox runat="server" ID="txt_Email" Width="380px" MaxLength="70" Text='<%# Bind("Email") %>' />
              <asp:RequiredFieldValidator ID="rfv_Email" runat="server" ControlToValidate="txt_Email"
                Display="None" ErrorMessage="Preencha seu Email" SetFocusOnError="true" />
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
            <div style="float: left;">
              Informações
            </div>
            <div style="float: right;">
              <asp:TextBox ID="txt_Informacoes" runat="server" Height="50px" Text='<%# Bind("Informacoes") %>'
                TextMode="MultiLine" Width="365px" />
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
            <div style="float: left;">
              <asp:Button ID="btnAtualizar" runat="server" Text="Atualizar" CommandName="Update"
                UseSubmitBehavior="False" SkinID="dtvButton" />&nbsp;&nbsp;&nbsp;
            </div>
            <div style="float: left;">
              <asp:Button ID="btnCancelarAlteracao" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancelar" OnClick="btnCancelarAlteracao_Click" UseSubmitBehavior="False"
                SkinID="dtvButton" />
            </div>
            <div style="clear: both; line-height: 5px;">
              <br />
            </div>
          </div>
          <div style="float: right;">
            <asp:Image ID="img_Avatar" runat="server" ImageUrl='<%# "~/imagens/avatar/" & IIF(Eval("Avatar")="", "sem_avatar.jpg", Eval("Avatar")) %>'
              BorderWidth="1" AlternateText="" />
          </div>
          <br />
        </EditItemTemplate>
      </asp:FormView>
      <asp:ValidationSummary ID="ValidationSummary2" runat="server" ShowMessageBox="true" />
      <asp:Label ID="lblErro" runat="server" Visible="False" SkinID="lblVermelhoBold" />
    </ContentTemplate>
  </asp:UpdatePanel>
</asp:Content>
